<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // map是把数组进行遍历,每一项进行相同的处理操作,得到一个新的数组
        const arr = [2, 3, 4, 5]//[4,9,16,25]
        console.log(arr.map(item => Math.pow(item, 2)));
    </script>
</body>

</html>